default="1024x768");
parser.add_option("-w", "--wide", action="store_true",
help="Use widescreen (1280x800) with Xephyr")
+parser.add_option("", "--eval-file", metavar="EVAL_FILE",
+ help="Evaluate the contents of the given JavaScript file")
options, args = parser.parse_args()
parser.print_usage()
sys.exit(1)
+if options.eval_file:
+ import dbus
+
+ f = open(options.eval_file)
+ contents = f.read()
+ f.close()
+
+ session = dbus.SessionBus()
+ shell = session.get_object('org.gnome.Shell', '/org/gnome/Shell')
+ shell = dbus.Interface(shell, 'org.gnome.Shell')
+ result = shell.Eval(contents)
+ print result
+ sys.exit(0)
+
if options.debug_command:
options.debug = True
elif options.debug: